<html>
<head><meta charset="utf-8"><title>Problems with TypeScript build · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html">Problems with TypeScript build</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="187254776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187254776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187254776">(Feb 03 2020 at 11:48)</a>:</h4>
<p>When I try to build the extension with a task, I get this</p>



<a name="187254778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187254778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187254778">(Feb 03 2020 at 11:48)</a>:</h4>
<p><a href="/user_uploads/4715/XI_DaQNt7QIqtiNZ42rY9VDI/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/XI_DaQNt7QIqtiNZ42rY9VDI/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/XI_DaQNt7QIqtiNZ42rY9VDI/pasted_image.png"></a></div>



<a name="187254787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187254787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187254787">(Feb 03 2020 at 11:48)</a>:</h4>
<p>Can it be related to that module thing? cc <span class="user-mention" data-user-id="258149">@std::Veetaha</span> ?</p>



<a name="187254982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187254982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187254982">(Feb 03 2020 at 11:52)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span>  Can you try to set <code>"moduleResoltion": "node"</code> in tsconfig? I had this on my mind when applying the morning fix, but since <code>rollup</code> successfully produced the artifact I didn't pay attention to it, sorry...</p>



<a name="187255218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187255218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187255218">(Feb 03 2020 at 11:57)</a>:</h4>
<p>Its a miracle how <code>rollup</code> doesn't catch this... It uses some custom TypeScript compilation settings that differ from <code>tsc</code>...<br>
What happened is that with switching from <code>commonjs</code> module to <code>es2015</code> the default typechecker <code>moduleResolution</code> strategy also switched from <code>node</code> to <code>classic</code> which is not intended...<br>
Maybe we should indeed add <code>tsc --noEmit</code> in CI since the behaviour of it and <code>rollup</code> is so different</p>



<a name="187259610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187259610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187259610">(Feb 03 2020 at 13:04)</a>:</h4>
<p>Hm, with <code>moduleResolution: node</code> it compiles, but failes at runtime with a parse error</p>



<a name="187259635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187259635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187259635">(Feb 03 2020 at 13:05)</a>:</h4>
<div class="codehilite"><pre><span></span>rust-analyzer/editors/code/out/main.js:1
(function (exports, require, module, __filename, __dirname) { import * as vscode from &#39;vscode&#39;;
                                                                     ^

SyntaxError: Unexpected token *
</pre></div>



<a name="187260062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187260062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187260062">(Feb 03 2020 at 13:11)</a>:</h4>
<p>Okay, we have very interesting situation) We produce es2015 output for rollup, but when developing this must be a ready-to-use commonjs</p>



<a name="187260148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187260148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187260148">(Feb 03 2020 at 13:12)</a>:</h4>
<p>Am I correct that Node that is used with electorn (12) supports only common js, but not es2015?</p>



<a name="187260191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187260191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187260191">(Feb 03 2020 at 13:13)</a>:</h4>
<p>Yes, in order to use es2015, files should have extension <code>.mjs</code>.</p>



<a name="187260253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187260253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187260253">(Feb 03 2020 at 13:14)</a>:</h4>
<p>I propose to create <code>tsconfig.dev.json</code> where it <code>"extends": "./tsconfig.json"</code> and overrides <code>"module": "commonjs"</code></p>



<a name="187260271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187260271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187260271">(Feb 03 2020 at 13:14)</a>:</h4>
<p>Otherwise we would need to setup rollup for development watch mode</p>



<a name="187260417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187260417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187260417">(Feb 03 2020 at 13:17)</a>:</h4>
<p>Or we just downgrade <code>@rollup/typescript-plugin</code> to <code>2.1.0</code> and switch to <code>commonjs</code> so I think of the better setup today</p>



<a name="187260880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187260880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187260880">(Feb 03 2020 at 13:20)</a>:</h4>
<p>hm, </p>
<p><a href="https://github.com/rollup/plugins/tree/master/packages/typescript#ignored-options" target="_blank" title="https://github.com/rollup/plugins/tree/master/packages/typescript#ignored-options">https://github.com/rollup/plugins/tree/master/packages/typescript#ignored-options</a></p>
<p>Ignored options</p>
<blockquote>
<p>noEmitHelpers, importHelpers: The tslib helper module always must be used.</p>
</blockquote>



<a name="187260901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187260901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187260901">(Feb 03 2020 at 13:21)</a>:</h4>
<p>what does this actually mean?</p>



<a name="187261067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187261067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187261067">(Feb 03 2020 at 13:23)</a>:</h4>
<p>This is what <a href="https://github.com/rust-analyzer/rust-analyzer/issues/2992#issuecomment-581291811" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/2992#issuecomment-581291811">I saw earlier today</a>, it always uses <code>tslib</code> no matter what <code>importHelpers</code> option is set to.<br>
However it should be enabled to be used for development builds with <code>tsc</code></p>



<a name="187261207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187261207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187261207">(Feb 03 2020 at 13:25)</a>:</h4>
<p>Hm, I remmeber why tslib ended up in dev deps</p>



<a name="187261209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187261209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187261209">(Feb 03 2020 at 13:25)</a>:</h4>
<p><a href="https://github.com/rollup/rollup-plugin-typescript#installation" target="_blank" title="https://github.com/rollup/rollup-plugin-typescript#installation">https://github.com/rollup/rollup-plugin-typescript#installation</a></p>



<a name="187261228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187261228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187261228">(Feb 03 2020 at 13:25)</a>:</h4>
<p>that's what the docs for rollup originally said</p>



<a name="187261563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187261563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187261563">(Feb 03 2020 at 13:29)</a>:</h4>
<p>I see that they say that <code>"extensions": [".ts"]</code> is required in <code>commonjs</code> plugin options, maybe this is why the bundling behavior changed from 2.1.0 to 3.0.0<br>
<a href="https://github.com/rollup/plugins/blob/master/packages/typescript/README.md#importing-commonjs" target="_blank" title="https://github.com/rollup/plugins/blob/master/packages/typescript/README.md#importing-commonjs">https://github.com/rollup/plugins/blob/master/packages/typescript/README.md#importing-commonjs</a></p>



<a name="187261806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187261806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187261806">(Feb 03 2020 at 13:32)</a>:</h4>
<p>Having <code>tslib</code> as dev dependency is inherently weird. Maybe they meant it to be dev dependency because the resulting bundle doesn't depend on anything from <code>node_modules</code>, but this way we could say that any dependency is dev dependency</p>



<a name="187262182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187262182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187262182">(Feb 03 2020 at 13:37)</a>:</h4>
<p>Let's just downgrade the plugin to <code>2.1.0</code> and switch to <code>"module": "commonjs"</code> for now, ok?</p>



<a name="187262506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187262506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187262506">(Feb 03 2020 at 13:41)</a>:</h4>
<p>Very sorry for wasting you time...</p>



<a name="187263469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187263469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187263469">(Feb 03 2020 at 13:53)</a>:</h4>
<p>I think that uptodate bundler plus a dev dep on tslib is better than old bundler</p>



<a name="187263521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187263521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187263521">(Feb 03 2020 at 13:54)</a>:</h4>
<p>I agree that devdep for tslib is super weired thoguh :)</p>



<a name="187263555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187263555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187263555">(Feb 03 2020 at 13:54)</a>:</h4>
<p>And no, this is definitelly not a time waste, as we've lerned a bunch about the limitation of the tools we use</p>



<a name="187263590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187263590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187263590">(Feb 03 2020 at 13:55)</a>:</h4>
<p>The only waste here is that nodejs ecosystem is kind of ungood, in my humble option, but we just have to work with it</p>



<a name="187263700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187263700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187263700">(Feb 03 2020 at 13:56)</a>:</h4>
<p>And of course I can't place a comment into package.json to explain this weirdness</p>



<a name="187263708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187263708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187263708">(Feb 03 2020 at 13:56)</a>:</h4>
<p>/me shakes fist at heaven</p>



<a name="187263746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187263746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187263746">(Feb 03 2020 at 13:57)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span>, I think one day we should migrate from rollup to webpack, since it is the  unspoken standard bundler, anyway...<br>
No need for a comment, I'll tackle it today!</p>



<a name="187264358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187264358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187264358">(Feb 03 2020 at 14:04)</a>:</h4>
<p>There was an attempt to do that in <a href="https://github.com/rust-analyzer/rust-analyzer/pull/1451" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/pull/1451">https://github.com/rust-analyzer/rust-analyzer/pull/1451</a>. But isn't rollup supposed to be newer and better?</p>



<a name="187265321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187265321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187265321">(Feb 03 2020 at 14:14)</a>:</h4>
<p><span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> well rollup was published 5 years ago and webpack 8 years ago. I am not sure wether this is the new better guy on the market, I am just following the trends )<br>
<a href="https://www.npmtrends.com/rollup-vs-webpack" target="_blank" title="https://www.npmtrends.com/rollup-vs-webpack">https://www.npmtrends.com/rollup-vs-webpack</a></p>



<a name="187265832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187265832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187265832">(Feb 03 2020 at 14:19)</a>:</h4>
<p>I just read the blurb, it says "next-generation" <span aria-label="grinning" class="emoji emoji-1f600" role="img" title="grinning">:grinning:</span></p>



<a name="187266076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187266076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187266076">(Feb 03 2020 at 14:22)</a>:</h4>
<p>I wonder if anyone is working on Code bindings for Rust</p>



<a name="187266699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187266699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187266699">(Feb 03 2020 at 14:31)</a>:</h4>
<p>Speaking about "next-generation" I heard that initially <code>webpack</code> was a very good piece of software, it got popularity, but somehow its maintainers didn't support it very much and that's why new bundlers (maybe rollup was one of them) appeared. However after some time <code>webpack</code> maintainers caught up and started developing it very much to the state that it is now dominating the market.</p>



<a name="187266887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187266887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187266887">(Feb 03 2020 at 14:33)</a>:</h4>
<p>The metrick I use is the size of package.json.lock :D</p>



<a name="187273881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187273881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joe Clay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187273881">(Feb 03 2020 at 15:47)</a>:</h4>
<blockquote>
<p>And of course I can't place a comment into package.json to explain this weirdness</p>
</blockquote>
<p>FWIW, the <code>"//":</code> key is <a href="https://groups.google.com/forum/#!msg/nodejs/NmL7jdeuw0M/yTqI05DRQrIJ" target="_blank" title="https://groups.google.com/forum/#!msg/nodejs/NmL7jdeuw0M/yTqI05DRQrIJ">reserved for comments</a> in <code>package.json</code>. Feels a bit kludgy to use that though <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="187274107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187274107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joe Clay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187274107">(Feb 03 2020 at 15:50)</a>:</h4>
<p>and on the topic of webpack vs. rollup, general consensus I've heard is that the former is better for applications, the latter is better for libraries. If you're literally just bundling your JS rather than doing anything fancy, I'd definitely recommend avoiding the hassle of maintaining a Webpack config file <span aria-label="grimacing" class="emoji emoji-1f62c" role="img" title="grimacing">:grimacing:</span></p>



<a name="187279636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187279636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187279636">(Feb 03 2020 at 16:43)</a>:</h4>
<p><span class="user-mention" data-user-id="258149">@std::Veetaha</span> btw the today's morning problem, "build works via rollup, but not via build task" is exactly an issue which wouldn't be caught by an end-to-end test. It seems like you should just suffer through similar things :-(</p>



<a name="187280083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187280083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187280083">(Feb 03 2020 at 16:46)</a>:</h4>
<p>No suffering! Build task is just a script that invokes <code>tsc --watch</code>, if we add <code>tsc --noEmit</code> to CI we can tackle at least the issue with compile-time inconsistencies between <code>rollup</code> and  <code>tsc</code>.</p>



<a name="187280318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187280318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187280318">(Feb 03 2020 at 16:49)</a>:</h4>
<p>For the discrepancies, I think <a href="https://github.com/rust-analyzer/rust-analyzer/pull/3003" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/pull/3003">https://github.com/rust-analyzer/rust-analyzer/pull/3003</a> might actually be a better approach: just don't  let that rollup plugin to mess up with typescript build.</p>
<p>But my point is that, for integration, things usually break in a pretty surprising ways, which are not tested. Like, after every specific failure you can add a test that will catch this specific failure, but the probability that it won't catch the next failure is pretty high</p>



<a name="187280511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187280511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187280511">(Feb 03 2020 at 16:51)</a>:</h4>
<blockquote>
<p>Not mess with typescript build</p>
</blockquote>
<p>Do you want to feed compiled JavaScript artifacts to rollup instead of using the typescript plugin?</p>



<a name="187280562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187280562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187280562">(Feb 03 2020 at 16:52)</a>:</h4>
<p>exactly</p>



<a name="187280617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Problems%20with%20TypeScript%20build/near/187280617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> std::Veetaha <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Problems.20with.20TypeScript.20build.html#187280617">(Feb 03 2020 at 16:52)</a>:</h4>
<p>This is a good point, though it may take a bit more seconds to assemble the package, but we won't have these inconsistencies anyway</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>